package org.qf.service.impl;

import org.qf.dao.impl.SmbmsGoodsDaoimpl;
import org.qf.pojo.Goods;
import org.qf.service.SmbmsGoodsService;

import java.util.List;

/**
 * @author zzzyyystart
 * @create 2022-05-11-20:03
 */
public class SmbmsGoodsServiceImpl implements SmbmsGoodsService {
    SmbmsGoodsDaoimpl goodsDao = new SmbmsGoodsDaoimpl();

    @Override
    public List<Goods> showGoods(String classifyName) {
        try {
            return goodsDao.showGoods(classifyName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public Goods showGoodForOne(String classifyName,String goodsId) {
        try {
           return  goodsDao.showGoodForOne(classifyName,goodsId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public int updateGoods(String classifyName,Goods goods){
        try {
            return goodsDao.updateGoods(classifyName,goods);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public int addGoods(String classify, Goods goods) {
        try {
            return goodsDao.addGoods(classify, goods);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public int deleteGoods(String goodsId, String classifyName) {
        try {
           return  goodsDao.deleteGoods(goodsId, classifyName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }
}
